package com.spring.mvc.mina.codec;

import org.apache.mina.core.buffer.IoBuffer;
import org.apache.mina.core.session.IoSession;
import org.apache.mina.filter.codec.CumulativeProtocolDecoder;
import org.apache.mina.filter.codec.ProtocolDecoderOutput;

public class PduProtocolDecoder extends CumulativeProtocolDecoder{

	@Override
	protected boolean doDecode(IoSession session, IoBuffer in, ProtocolDecoderOutput out) throws Exception {
		if(in.prefixedDataAvailable(4,4194304)){
			return false;
		}
		byte[] tem=new byte[in.limit()];
		in.get(tem);
		out.write(tem);
		return true;
	}

}
